<template>
	<div v-if="data" >
	  <div class="or-base bwt" v-if="data.order" >
	  	<div ><img :src="data.trademark.faceUrl"></div>
	  	<div class="info">
	  		<div class="name">{{data.offlineShop.name}}</div>
	  		<div class="sku" v-if="data.vaccine && data.vaccine.products">
	  			<span v-for="(item,ind) in data.vaccine.products" >{{item}}</span>
	  		</div>
	  		<div v-if="data.order">
	  			<div class="pri" v-if="data.order.payType == 4 || data.order.payType == 5">港币 <span>{{data.order.payAmount}}</span></div>
	  			<div class="pri" v-else >&yen; <span>{{data.order.payAmount}}</span></div>
	  		</div>
	  	</div>
	  </div>
	  <div class="bwt or-user" v-if="data.vaccine && data.vaccine.name">
	  	<div class="tit">接种人信息</div>
	  	<div><span>姓名：</span>{{data.vaccine.name}}</div>
	  	<div><span>出生日期：</span>{{data.vaccine.birthday.substring(0, 10)}}</div>
	  	<div><span>手机号：</span>{{data.vaccine.mobile}}</div>
	  	<div class="remark"><span>备注：</span>{{data.vaccine.remark}}</div>
	  </div>
	  <div class="or-time">
	  	<div>订单编号：{{data.order.orderNo}}</div>
	  	<div>订单时间：{{data.order.createDate}}</div>
	  </div>
	</div>
</template>
<script>
  export default {
    name: 'orderdetial',
    data () {
      return {
        data: {
          order: {},
          offlineShop: {},
          trademark: {},
          vaccine: {}
        }
      }
    },
    mounted () {
      this.init()
    },
    methods: {
      init () {
        this.getDetial()
      },
      getDetial: function () {
        this.$EcHttpUtils.get('order/detail.json', {id: this.$route.params.id}).then((resp) => {
          if (resp.data.statusCode === 0) {
            // resp.data.data.
            if (resp.data.data.vaccine && resp.data.data.vaccine.products) {
              resp.data.data.vaccine.products = JSON.parse(resp.data.data.vaccine.products)
            }
            this.data = resp.data.data
          }
        })
      }
    }
  }
</script>
